import request from '@/utils/request'

//获取订阅列表
export function fetchList(params) {
    return request({
        url: '/system/report/job/list',
        method: 'get',
        params
    })
}

//新增订阅任务
export function jobAdd(data) {
    return request({
        url: '/system/report/job/add',
        method: 'post',
        data
    })
}

//订阅任务详情
export function getInfo(params) {
    return request({
        url: '/system/report/job/getInfo',
        method: 'get',
        params
    })
}

//编辑订阅任务
export function jobEdit(data) {
    return request({
        url: '/system/report/job/edit',
        method: 'post',
        data
    })
}

//启用/停用
export function updateStatus(data) {
    return request({
        url: '/system/report/job/changeStatus',
        method: 'post',
        data
    })
}

//删除
export function jobDelete(data) {
    return request({
        url: '/system/report/job/remove',
        method: 'post',
        data
    })
}

//报告列表
export function reportList(params) {
    return request({
        url: '/system/report/form/list',
        method: 'get',
        params
    })
}

//根据任务id获取当前已选择的任务列表
export function getSelectedReports(params) {
    return request({
        url: '/system/report/job/getReportDetail',
        method: 'get',
        params
    })
}

//历史记录
export function getHistory(params) {
    return request({
        url: '/system/report/job/getHis',
        method: 'get',
        params
    })
}